package org.dromara.hm.domain.bo;

import org.dromara.hm.domain.HmPaymentAdjustment;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 回款调整记录业务对象 hm_payment_adjustment
 *
 * @author Claude Code
 * @date 2025-01-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = HmPaymentAdjustment.class, reverseConvertGenerate = false)
public class HmPaymentAdjustmentBo extends BaseEntity {

    /**
     * 调整记录ID
     */
    @NotNull(message = "调整记录ID不能为空", groups = { EditGroup.class })
    private Long adjustmentId;

    /**
     * 销售订单ID
     */
    @NotNull(message = "销售订单ID不能为空", groups = { AddGroup.class })
    private Long saleId;

    /**
     * 调整类型：DEBT_RELIEF=债务减免, ERROR_CORRECTION=错误修正, BAD_DEBT=坏账核销, AGING_ADJUSTMENT=账龄调整, DEBT_RESTRUCTURE=债务重组, OTHER=其他
     */
    @NotBlank(message = "调整类型不能为空", groups = { AddGroup.class })
    private String adjustmentType;

    /**
     * 调整金额（正数=减少未回款，负数=增加未回款）
     */
    @NotNull(message = "调整金额不能为空", groups = { AddGroup.class })
    private BigDecimal adjustmentAmount;

    /**
     * 调整前未回款金额
     */
    private BigDecimal originalUnpaidAmount;

    /**
     * 调整后未回款金额
     */
    private BigDecimal newUnpaidAmount;

    /**
     * 原因代码
     */
    private String reasonCode;

    /**
     * 详细说明
     */
    @NotBlank(message = "详细说明不能为空", groups = { AddGroup.class })
    private String description;

    /**
     * 证明材料文件路径（多个用逗号分隔）
     */
    private String proofFiles;

    /**
     * 证明材料文件列表（用于接收前端上传）
     */
    private List<String> proofFileList;

    /**
     * 申请时间
     */
    private Date applyTime;

    /**
     * 申请人ID
     */
    private Long applicantId;

    /**
     * 申请人姓名
     */
    private String applicantName;

    /**
     * 状态：PENDING=待审核, APPROVED=已批准, REJECTED=已驳回, CANCELLED=已取消
     */
    private String status;

    /**
     * 审核人ID
     */
    private Long approverId;

    /**
     * 审核人姓名
     */
    private String approverName;

    /**
     * 审核时间
     */
    private Date approveTime;

    /**
     * 审核备注
     */
    private String approveRemark;

    // ========= 查询条件参数 =========

    /**
     * 申请开始时间（查询用）
     */
    private Date applyStartTime;

    /**
     * 申请结束时间（查询用）
     */
    private Date applyEndTime;

    /**
     * 审核开始时间（查询用）
     */
    private Date approveStartTime;

    /**
     * 审核结束时间（查询用）
     */
    private Date approveEndTime;
}
